﻿using SYJ.IDAL;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;

namespace SYJ.Factory
{
   public class DALFactory
    {
       private static readonly string path = ConfigurationManager.AppSettings["DAL"];
       public DALFactory() { }

       public static ISysPermissionDAL CreateSysPermissionDAL()
       {
           string className = "SYJ.MySqlDAL.SysPermissionDAL";
           return (ISysPermissionDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static ISysUserDAL CreateSysUserDAL()
       {
           string className = "SYJ.MySqlDAL.SysUserDAL";
           return (ISysUserDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static ISysRoleDAL CreateSysRoleDAL()
       {
           string className = "SYJ.MySqlDAL.SysRoleDAL";
           return (ISysRoleDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static IContestDAL CreateContestDAL()
       {
           string className = "SYJ.MySqlDAL.ContestDAL";
           return (IContestDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static IContestLoveLogDAL CreateContestLoveLogDAL()
       {
           string className = "SYJ.MySqlDAL.ContestLoveLogDAL";
           return (IContestLoveLogDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static IContestPictureDAL CreateContestPictureDAL()
       {
           string className = "SYJ.MySqlDAL.ContestPictureDAL";
           return (IContestPictureDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static IContestResultDAL CreateContestResultDAL()
       {
           string className = "SYJ.MySqlDAL.ContestResultDAL";
           return (IContestResultDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static INoticeDAL CreateNoticeDAL()
       {
           string className = "SYJ.MySqlDAL.NoticeDAL";
           return (INoticeDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static INoticeTypeDAL CreateNoticeTypeDAL()
       {
           string className = "SYJ.MySqlDAL.NoticeTypeDAL";
           return (INoticeTypeDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static ISysConfigDAL CreateSysConfigDAL()
       {
           string className = "SYJ.MySqlDAL.SysConfigDAL";
           return (ISysConfigDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static ISysLeavesDAL CreateSysLeavesDAL()
       {
           string className = "SYJ.MySqlDAL.SysLeavesDAL";
           return (ISysLeavesDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static ISysOperateDAL CreateSysOperateDAL()
       {
           string className = "SYJ.MySqlDAL.SysOperateDAL";
           return (ISysOperateDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static ISysPermissionRoleOperateBindDAL CreateSysPermissionRoleOperateBindDAL()
       {
           string className = "SYJ.MySqlDAL.SysPermissionRoleOperateBindDAL";
           return (ISysPermissionRoleOperateBindDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
       public static ISysUserRoleBindDAL CreateSysUserRoleBindDAL()
       {
           string className = "SYJ.MySqlDAL.SysUserRoleBindDAL";
           return (ISysUserRoleBindDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }

       public static IUserAlbumsDAL CreateUserAlbumsDAL()
       {
           string className = "SYJ.MySqlDAL.UserAlbumsDAL";
           return (IUserAlbumsDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }

       public static IUserGroupsDAL CreateUserGroupsDAL()
       {
           string className = "SYJ.MySqlDAL.UserGroupsDAL";
           return (IUserGroupsDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }

       public static IUserPictureDAL CreateUserPictureDAL()
       {
           string className = "SYJ.MySqlDAL.UserPictureDAL";
           return (IUserPictureDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }

       public static ISysLinksDAL CreateSysLinksDAL()
       {
           string className = "SYJ.MySqlDAL.SysLinksDAL";
           return (ISysLinksDAL)Assembly.Load("SYJ.MySqlDAL").CreateInstance(className);
       }
    }
}
